[string]$Writer_Name = 'Microsoft Exchange Writer'
[string]$Expected_Status = 'Stable'
[string]$Expected_Status_2 = 'Waiting for completion'

$vssadmin_list_writers = vssadmin list writers

$Line = 0
foreach ($str in $vssadmin_list_writers) {
    if ($str -match $Writer_Name) {
        # Status所在的行数
        $Line += 3
        if ($vssadmin_list_writers[$Line] -match $Expected_Status) {
            return $True
        }
        if ($vssadmin_list_writers[$Line] -match $Expected_Status_2) {
            return $True
        }
        return $False
    }
    $Line++
}
return $False